<?php if (!defined('THINK_PATH')) exit(); /*a:3:{s:58:"D:\phpStudy\WWW\auth/application/web\view\order\index.html";i:1496201822;s:58:"D:\phpStudy\WWW\auth/application/web\view\public\base.html";i:1496201802;s:56:"D:\phpStudy\WWW\auth/application/web\view\order\top.html";i:1496201818;}*/ ?>
<!DOCTYPE html>
<html>

	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title>商家后台管理</title>
		<meta name="keywords" content="">
		<meta name="description" content="">
		<!--[if lt IE 9]>
    	<meta http-equiv="refresh" content="0;ie.html" />
    	<![endif]-->
		<link rel="shortcut icon" href="favicon.ico">
		<link href="__CSS__/bootstrap.min.css" rel="stylesheet">
		<link href="__CSS__/font-awesome.min.css" rel="stylesheet">
		<link href="__CSS__/animate.min.css" rel="stylesheet">
		<link href="__CSS__/style.min.css" rel="stylesheet">
		<link href="__CSS__/admin.css" rel="stylesheet">
	</head>
	<style>
		.lactive {
			background: #293846;
			color: #FFFFFF;
			border-bottom: solid 2px #1ab394
		}
		
		.lactive> a {
			color: #ffffff!important;
		}
	</style>

	<body class="fixed-sidebar full-height-layout gray-bg" style="overflow:hidden">
		<div id="wrapper">
			<!--左侧导航开始-->
			<div class="navbar_top_nav">
				<ul class="nav navbar-top-links navbar-left">
					<li class="nspecial">
						<span class="block m-t-xs"><strong class="font-bold">
							<?php echo session('storeInfo')['store_name']; if($chainsotrename!==''): ?>
							(<?php echo $chainsotrename; ?>)
							<?php endif; ?>
						</strong></span>
					</li>
					<li class="hidden-xs" id='shouye'>
						<a href="<?php echo url('index/index'); ?>">
							&nbsp;&nbsp;<i class="fa fa-home"></i>首页&nbsp;&nbsp;
						</a>
					</li>
					<?php if(is_array($store_top_menus) || $store_top_menus instanceof \think\Collection): if( count($store_top_menus)==0 ) : echo "" ;else: foreach($store_top_menus as $key=>$st): ?>
					<li id="top_menu<?php echo $st['id']; ?>">
						<a href="/<?php echo $st['name']; ?>?top_menu_id=<?php echo $st['id']; ?>"><i class='<?php echo $st['icon']; ?>'></i><?php echo $st['title']; ?></a>
					</li>
					<?php endforeach; endif; else: echo "" ;endif; ?>
				</ul>
				<ul class="nav navbar-top-links navbar-right">
					<li class="hidden-xs">
						<a href="/help" target="_blank">
							<i class="fa fa-chain"></i>帮助文档
						</a>
					</li>

					<li class="hidden-xs">
							<a data-toggle="dropdown" href="#">
								<i class="fa fa-chain"></i>系统管理<b class="caret"></b>
							</a>
							<ul class="dropdown-menu animated fadeInRight m-t-xs">
								<li>
									<a onclick="jiaoban()" }>
										<i class="fa fa-chain"></i>交班
									</a>
								</li>
								<li class="divider"></li>
								<li>
									<a href="<?php echo url('index/clear'); ?>">
										<i class="fa fa-refresh"></i>清除缓存
									</a>
								</li>
								<li>
									<a href="<?php echo url('login/logout'); ?>"><i class="fa fa-sign-out"></i>退出系统</a>
								</li>
							</ul>
					</li>
				</ul>

			</div>
			<nav class="navbar-default navbar-static-side" role="navigation" style="margin-top: 60px;">

				<div class="sidebar-collapse">
					<ul class="nav" id="side-menu">

						<li class="menu" style="text-align: center; background-color:#08575B;">
							<a class="navbar-minimalize" href="#" style="text-align: center; background-color:#08575B;">
								<i class="fa fa-bars"></i>
							</a>
						</li>
						<?php if(!empty($menu)): if(is_array($menu) || $menu instanceof \think\Collection): if( count($menu)==0 ) : echo "" ;else: foreach($menu as $key=>$vo): ?>
						<li class="menu" style="text-align:left">
							<a href="/<?php echo $vo['name']; ?>?top_menu_id=<?php echo $top_menu_id; ?>">
								<i class="<?php echo $vo['icon']; ?>" style="width: 15px;"></i>
								<span class="nav-label"><?php echo $vo['title']; ?>&nbsp;&nbsp; </span>
							</a>
						</li>
						<?php endforeach; endif; else: echo "" ;endif; endif; ?>
					</ul>
				</div>
			</nav>
			<!--左侧导航结束-->
			<!--右侧部分开始-->
			<div id="page-wrapper" class="gray-bg dashbard-1">
				<div class="row border-bottom" style="display: none;">
					<nav class="navbar navbar-static-top" role="navigation" style="margin-bottom: 0;">
						<div class="navbar-header">
							<a class="navbar-minimalize " href="#">
							</a>
						</div>

					</nav>
				</div>
				<div class="row" style="margin-top: 66px;">
					
<div class="ibox float-e-margins">
	<div class="content-tabs">
		<ol class="breadcrumb">
			<li>
				<a href="<?php echo url('index/index'); ?>"><i class="fa fa-home"></i></a>
			</li>
			<li><strong>在线订单列表</strong></li>

		</ol>
	</div>

	<div class="ibox-title">
	<ul class="nav nav-tabs">
		<li id="li-bar-si">
			<a href="<?php echo url('Order/index',['status' => 0]); ?>" >全部</a>
		</li>
		<li id="li-bar-site">
			<a href="<?php echo url('Order/index',['status' => 1]); ?>">未付款</a>
		</li>
		<li id="li-bar-sms">
			<a href="<?php echo url('Order/index',['status' => 2]); ?> ">拼团中</a>
		</li>
		<li id="li-bar-pay">
			<a href="<?php echo url('Order/index',['status' => 3]); ?> ">待发货</a>
		</li>
		<li id="li-bar-log">
			<a href="<?php echo url('Order/index',['status' => 4]); ?> ">已发货</a>
		</li>
		<li id="li-bar-wechat">
			<a href="<?php echo url('Order/index',['status' => 5]); ?> ">已完成</a>
		</li>
		<li id="li-bar-three">
			<a href="<?php echo url('Order/index',['status' => 6]); ?> ">已关闭</a>
		</li>
		<li id="li-bar-three">
			<a href="<?php echo url('Order/index',['status' => 16]); ?> ">待处理退款订单</a>
		</li>
		<li id="li-bar-three">
			<a href="<?php echo url('Order/index',['status' => 17]); ?> ">不退款订单</a>
		</li>
		<li id="li-bar-three">
			<a href="<?php echo url('Order/index',['status' => 18]); ?> ">已退款订单</a>
		</li>
	</ul>
</div>
	<div class="ibox-content">
		<form id="myForm" class="form-horizontal m-t" method="post" action="<?php echo url('index',['status'=>$status]); ?>">
			<div class="row">
				<div class="form-group">&nbsp;&nbsp;&nbsp;&nbsp; 订单类型
					<select name="express_type" class="bank" style="width: 100px;">
						<option value="0">全部订单</option>
						<option value="1">快递订单</option>
						<option value="2">O2O订单</option>
					</select>
					订单号<input type="text" id="order_number" name="order_number" value="" placeholder="请输入订单号" class="bank" /> 下单时间
					<input id='start_time' name='start_time' style="width: 90px;" onclick='WdatePicker()' type='text' placeholder="开始时间" class="bank" />
					<input id='end_time' name='end_time' style="width: 90px;" onclick='WdatePicker()' type='text' placeholder="结束时间" class="bank" /> 收货人姓名
					<input type="text" id="receiver" name="receiver" value="" placeholder="请输入收货人姓名" class="bank" /> 手机号
					<input type="text" id="receiver_mobile" name="receiver_mobile" value="" placeholder="请输入收货人手机" class="bank" />
					<button type="submit" class="btn btn-sm btn-primary"><li class="fa fa-search"> 查询</li></button>
					<a href="<?php echo url('export',['status'=>$status]); ?>" class="btn btn-primary btn-outline">导出订单信息</a>
					</span>
				</div>
			</div>
		</form>
		<div class="hr-line-dashed"></div>
		<div class="example-wrap">
			<div class="example">
				<table class="table table-bordered table-hover">
					<tbody id="list">
						<?php if(is_array($list1) || $list1 instanceof \think\Collection): if( count($list1)==0 ) : echo "" ;else: foreach($list1 as $key=>$order): ?>
						<tr>
							<td colspan="10"><span style="font-size:20px ;font-weight:bold;">订单类型:</span>
								<span style="font-size:15px ;font-weight:bold; color: #0000CC;">	
                        		<?php if($order['express_type']==1): ?>
                        			快递订单
                        			<?php elseif($order['express_type']==2): ?>
                        			O2O订单
                        			
                        	</span> <?php endif; ?>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
								<span style="font-size:20px ;font-weight:bold; color: #000000;">订单号:</span>
								<span style="font-size:15px ;font-weight:bold; color: #008200;"><?php echo $order['sn']; ?></span>

								<li style="padding-left: 1000px">
									<span style="padding-right:10px;">打印
                        				</span>

									<a href="<?php echo url('order/index'); ?>" class="fa fa-search"><strong>查看详情</a></strong>
								</li>
							</td>
						</tr>
						<tr class="long-tr">
							<th>商品名称</th>
							<th>单价/数量</th>
							<th>购买栏目</th>
							<th>用户支付</th>
							<th>买家</th>
							<th>下单时间</th>
							<th>订单状态</th>
							<th>实付金额</th>
						</tr>
						<?php if(is_array($order['items']) || $order['items'] instanceof \think\Collection): if( count($order['items'])==0 ) : echo "" ;else: foreach($order['items'] as $k=>$ad): ?>
						<tr>

							<td><img src="<?php echo $ad['thumb']; ?>" width="50px" /><?php echo $ad['goods_name']; ?></td>
							<td><?php echo $ad['price']; ?><br><?php echo $ad['number']; ?>(件)</td>
							<td>
								<?php if($ad['goods_lanmu']==1): ?> 疯狂抢 
								<?php elseif($ad['goods_lanmu']==2): ?> 优惠购 
								<?php elseif($ad['goods_lanmu']==3): ?> 赚积分 
								<?php elseif($ad['goods_lanmu']==4): ?> 云拼团
								<?php endif; ?>
							</td>
							<td><?php echo $ad['total_price']; ?></td>
							<td><?php echo $ad['username']; ?></td>
							<td><?php echo $ad['add_time']; ?></td>
							<?php if($k==0): ?>
							<td rowspan="<?php echo count($order['items']) ?>">
								<?php if($order['order_state']==1): ?> 待付款 
								<?php elseif($order['order_state']==2): ?> 拼团中
								<?php elseif($order['order_state']==3): ?> 待发货
								<br />
								<a class="btn btn-primary bnt-sm" onclick="show_fh('<?php echo $order['id']; ?>');">发货</a>
								<?php elseif($order['order_state']==16): ?> 
								申请退款--待处理
								<a class="btn btn-primary bnt-sm" onclick="handle_order('<?php echo $order['id']; ?>');">处理</a>
								<?php elseif($order['order_state']==4): ?> 已发货 
								<?php elseif($order['order_state']==5): ?> 已完成 
								<?php elseif($order['order_state']==6): ?> 已关闭 
								<?php elseif($order['order_state']==17): ?> 不同意退款
								<?php elseif($order['order_state']==18): ?> 同意退款
								<?php endif; ?>
							</td>
							<td rowspan="<?php echo count($order['items']) ?>">
								<?php echo $order['total_price']; ?>
							</td>
							<?php endif; ?>
						</tr>
						<?php endforeach; endif; else: echo "" ;endif; ?>
						<tr></tr>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</tbody>
				</table>
				<div style="text-align: right;">
					<?php echo $list->render(); ?>
				</div>
			</div>
		</div>
	</div>
</div>
<!--发货start-->
<div class="modal-content" id="map-dialog" style="display:none;height: 350px; position:fixed;z-index:1000;background:#fff;left: 35%;top: 20%;width:550px;">
	<div class="modal-header" style="padding: 5px;">
		<h2>订单发货<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="$('#map-dialog').hide()">×</button></h2></div>
	<div class="modal-body">
		<div id="map-container" class="row" style="margin-left:10px;overflow: hidden; position: relative; z-index: 0;  color: rgb(0, 0, 0); text-align: left;">
			<div class="form-group">
				<label class=" control-label">订单号</label>
				<div class="input-group col-sm-5" style="display: inline;padding-left: 30px;">
					<span id="sn"></span>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label">收货人</label>
				<div class="input-group " style="display: inline;padding-left: 30px;">
					<span id="shr"></span>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label">收货地址</label>
				<div class="input-group col-sm-5" style="display: inline;padding-left: 30px;">
					<span id="address"></span>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label">物流公司</label>
				<div class="input-group col-sm-5" style="display: inline;padding-left: 30px;">
					<select id="express">
						<option value="">
							选择物流公司
						</option>
						<?php if(is_array($express) || $express instanceof \think\Collection): if( count($express)==0 ) : echo "" ;else: foreach($express as $key=>$exp): ?>
						<option value="<?php echo $exp['value']['no']; ?>">
							<?php echo $exp['value']['name']; ?>
						</option>
						<?php endforeach; endif; else: echo "" ;endif; ?>
					</select>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label" style="float: left;">物流单号</label>
				<div class="input-group " style="display: inline;padding-left: 30px;">
					<input type="text" style="width: 250px;float: left;margin-left: 30px;" id="express_no" name="express_no" value="" placeholder="请输入物流单号" class="form-control" />
				</div>
			</div>
		</div>
		<br />
		<div class="modal-footer ">
			<a class="btn btn-default" data-dismiss="modal" onclick="javascript:$('#map-dialog').hide()">取消</a>
			<a onclick="fahuo()" class="btn btn-primary ">确认</a>
		</div>
	</div>
</div>
<!--发货end-->

	
<!--退款处理start -->
<div class="modal-content" id="tuikuan_order" style="display:none;height: 400px; position:fixed;z-index:1000;background:#fff;left: 35%;top: 20%;width:550px;">
	<div class="modal-header" style="padding: 5px;">
		<h2>订单发货<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="$('#tuikuan_order').hide()">×</button></h2></div>
	<div class="modal-body">
		<div id="map-container" class="row" style="margin-left:10px;overflow: hidden; position: relative; z-index: 0;  color: rgb(0, 0, 0); text-align: left;">
			<div class="form-group">
				<label class=" control-label" style="width: 25%;text-align: right;">订单号：</label>
				<div class="input-group col-sm-5" style="display: inline;padding-left: 30px;">
					<span id="order_sn"></span>
					<input type="hidden" id='cut_order_id'>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label" style="width: 25%;text-align: right;">收货人：</label>
				<div class="input-group " style="display: inline;padding-left: 30px;">
					<span id="order_shr"></span>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label" style="width: 25%;text-align: right;">收货地址：</label>
				<div class="input-group col-sm-5" style="display: inline;padding-left: 30px;">
					<span id="order_address"></span>
				</div>
			</div>
			<div class="form-group">
				<label class=" control-label" style="width: 25%;;text-align: right;float: left;">申请退款原因：</label>
				<div class="input-group " style="display: inline;padding-left: 30px;">
					<textarea disabled="disabled" rows="3" cols="20" id='drawback' style="height: 91px;width: 58%;background-color:#fff"></textarea>
				</div>
			</div>
		</div>
		<br />
		<div class="modal-footer ">
			<a class="btn btn-primary" onclick="no_agree($('#cut_order_id').val())">不同意退款</a>
			<a class="btn btn-primary" onclick="ok_drawback($('#cut_order_id').val())">同意退款</a>
		</div>
	</div>
</div>
<!--退款处理end-->
<!--不同意退款start-->
<div class="modal-content" id="not_drawback" style="display:none;height: 320px; position:fixed;z-index:1000;background:#fff;left: 35%;top: 20%;width:550px;">
	<div class="modal-header" style="padding: 5px;">
		<h2>退款处理<button type="button" class="close" data-dismiss="modal" aria-hidden="true" onclick="$('#not_drawback').hide()">×</button></h2></div>
	<div class="modal-body">
			<div class="form-group" id='not_content'>
				<input type="hidden" id='no_agree_id'>
				<label class=" control-label" style="width: 25%;float: left;">不同意退款原因：</label>
				<div class="input-group " style="display: inline;padding-left: 30px;">
					<textarea rows="3" cols="20" id='drawback_content' style="height: 91px;width: 58%;"></textarea>
				</div>
			</div>
		</div>
		<br />
		<div class="modal-footer ">
			<a class="btn btn-primary" onclick="not_drawback($('#no_agree_id').val())">确定</a>
		</div>
	</div>
</div>
<!--不同意退款end-->

				</div>
			</div>
			<!--右侧部分结束-->
		</div>
		<div class="footer">
			<div class="pull-right"> 版权所有 Project &copy; 2017-2020 版权所有</div>
		</div>
		<script src="__JS__/jquery.min.js"></script>
		<script src="__JS__/bootstrap.min.js"></script>
		<script src="__JS__/jquery.metisMenu.js"></script>
		<script src="__JS__/jquery.slimscroll.min.js"></script>
		<script src="__LIB__/layer/layer.js"></script>
		<script src="__JS__/core.min.js"></script>
		<script src="__JS__/pace.min.js"></script>
		<script src="__JS__/autocomplete.js"></script>
		<script>
			// 文件上传URL
			var __UPLOAD_URL__ = "<?php echo url('web/upload/index'); ?>";
			var __CURRENT_URL__ = "<?php echo $current_url; ?>";
			console.log(__CURRENT_URL__);
		</script>
		<script src="__JS__/admin.js"></script>
		<script>
			var show = "<?php echo $is_show_left; ?>";
			if(show == 0) {
				$("body").toggleClass("mini-navbar"), SmoothlyMenu();
			}
		</script>
		<script>
			var top_menu_id = "<?php echo $top_menu_id; ?>";
			$(".lactive").removeClass("lactive");
			if(top_menu_id != "") {
				$("#top_menu" + top_menu_id).addClass("lactive");
			} else {
				$("#shouye").addClass("lactive");
			}
			//交班操作
			function jiaoban1() {
				layer.open({
					type: 2,
					id: "jioaban_list",
					area: ['750px', '350px'],
					title: '收入',
					scrollbar: false,
					content: '/web/index/jiaoban_list' //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
				});
			}

			function jiaoban() {
				$.ajax({
					url: '/web/index/jiaoban_list',
					data: {},
					type: "post",
					success: function(data) {
						var info = data.data;
						var html = '<div class="input-group m-b" style="width:100%;text-align: center;">' +
							'<span style="color: red;font-size: 20px;">￥' +
							'<span id="total_price" style="color: red;font-size: 50px;" class="b_rs_pan">' + info.zsr + '</span></span>' +
							'</br><span>工作时间：' + info.startime + '至' + info.endtime + '</span>' +
							'</div>' +
							'<table class="table table-bordered table-hover">' +
							'<thead>' +
							'<tr class="long-th">' +
							'<th>现金</br>￥' + info.xianjin + '</th>' +
							'<th>银行卡</br>￥' + info.yinhangka + '</th>' +
							'<th>微信</br>￥' + info.weixin + '</th>' +
							'<th>支付宝</br>￥' + info.zhifubao + '</th>' +
							'<th>自定义</br>￥' + info.zidingyi + '</th>' +
							'</tr>' +
							'</thead>' +
							'</table>';
						var index = layer.open({
							title: '确认交班',
							zIndex: "addjb",
							area: ['750px', '300px'],
							content: html,
							btn: ['确定', '取消'],
							yes: function(index, layero) {
								//按钮【按钮一】的回调
								$.ajax({
									url: '/web/index/addjb',
									data: {
										total_icome: info.zsr,
										cash: info.xianjin,
										card_icome: info.yinhangka,
										wx_icome: info.weixin,
										zfb_icome: info.zhifubao,
										zdy_icome: info.zidingyi
									},
									type: "post",
									success: function(data) {
										layer.close(index);
										callback1(data);
									}
								})
							},
							btn2: function(index, layero) {
								layer.close(index);
							}
						});
					}
				});
			}

			function callback1(data) {
				if(data.code == 200) {
					var info = data.data;
					var html = '<div>' +
						'<div style="text-align: center;">' +
						'<i class="fa fa-check" style="color: #35b12c;font-size: 60px;font-weight: 600;"></i>' +
						'<p><span class="b_rs_pan">交班成功</span> </p>' +
						'</div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">交班时间：</label><div class="input-group col-sm-7">' + info.time + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">操作员：</label><div class="input-group col-sm-7">' + info.mobile + '</div></div>' +
						'<div class="form-group" style="padding-left: 100px;"><label class="col-sm-5 control-label">收入(元)：</label><div class="input-group col-sm-7">' + info.zsr + '</div></div>' +
						'</div>';
					var index = layer.open({
						title: '交班成功',
						area: ['500px', '350px'],
						content: html,
						btn: ['我知道了'],
						yes: function(index, layero) {
							layer.close(index);
						}
					});

				} else {
					layer.msg(data.msg);
					window.reload();
				}

			}
		</script>
		
<script src="__JS__/jquery.form.js"></script>
<script src="__LIB__/validate/jquery.validate.min.js"></script>
<script src="__LIB__/validate/messages_zh.min.js"></script>
<script src="__LIB__/validate/add_validate.min.js"></script>
<script src="__LIB__/fileinput/js/fileinput.min.js"></script>
<script src="__LIB__/fileinput/js/locales/zh.js"></script>
<script src="__LIB__/datepicker/WdatePicker.js"></script>
<script>
	if({
			$status
		} == 0) {
		$("#li-bar-si").addClass("active");
	}
	if({
			$status
		} == 1) {
		$("#li-bar-site").addClass("active");
	}
	if({
			$status
		} == 2) {
		$("#li-bar-sms").addClass("active");
	}
	if({
			$status
		} == 3) {
		$("#li-bar-pay").addClass("active");
	}
	if({
			$status
		} == 4) {
		$("#li-bar-log").addClass("active");
	}
	if({
			$status
		} == 5) {
		$("#li-bar-wechat").addClass("active");
	}
	if({
			$status
		} == 6) {
		$("#li-bar-three").addClass("active");
	}

	function fahuo() {
		var sn = $("#sn").text();
		var express = $("#express").val();
		var express_no = $("#express_no").val();
		if(express == "") {
			layer.msg("请选择物流方式");
			return false;
		}
		if(express_no == "") {
			layer.msg("请输入物流单号");
			return false;
		}
		$.ajax({
			//请求的url
			//注意，如果我们使用路由器的情况下，我们需要设置一下本地服务器的ip地址
			url: '/web/order/fahuo',
			//请求的过程中传递过去的参数 json
			data: {
				sn: sn,
				express: express,
				express_no: express_no
			},
			//成功了的回调，并且带有返回值
			success: function(data) {
				layer.msg(data.msg, {
					icon: 1,
					time: 1000 //2秒关闭（如果不配置，默认是3秒）
				}, function() {
					if(data.code == 200) {
						$('#map-dialog').hide();
						location.reload();
					}
				});

			}
		})

	}
	//发货
	function show_fh(id) {
		$.ajax({
			url: '/web/order/getOrderInfo',
			data: {
				order_id: id
			},
			//成功了的回调，并且带有返回值
			success: function(data) {
				if(data.code == 200) {
					var dt = data.order;
					$("#sn").text(dt.sn);
					$("#shr").text(dt.receiver + " " + dt.receiver_mobile);
					$("#address").text(dt.address);

				} else {
					layer.msg("订单不存在");
				}
			}
		})
		$("#map-dialog").show();
	}
	//处理退款
	function handle_order(id) {
		$.ajax({
			url: '/web/order/getOrderInfo',
			data: {
				order_id: id
			},
			//成功了的回调，并且带有返回值
			success: function(data) {
				if(data.code == 200) {
					var dt = data.order;
					$('#cut_order_id').val(dt.id);
					$("#order_sn").text(dt.sn);
					$("#order_shr").text(dt.receiver + " " + dt.receiver_mobile);
					$("#order_address").text(dt.address);
					$("#drawback").text(dt.drawback);

				} else {
					layer.msg("订单不存在");
				}
			}
		})
		$("#tuikuan_order").show();
	}
	
	//同意退款
	function ok_drawback(id){
		$.ajax({
			url: '/web/order/drawback',
			data: {
				order_id	: id
			},
			//成功了的回调，并且带有返回值
			success: function(data) {
				layer.msg(data.msg);
				$("#tuikuan_order").hide();
				location.href="<?php echo url('Order/index',['status' => 18]); ?>";
			}
		})
	}
	

	
	//不同意退款
	function not_drawback(id){
		$.ajax({
			url: '/web/order/no_agree',
			data: {
				order_id			: id,
				drawback_content	:$("#drawback_content").val()
				
			},
			//成功了的回调，并且带有返回值
			success: function(data) {
				layer.msg(data.msg);
				$("#not_drawback").hide();
				location.reload();
			}
		})
	}
	
	
	function no_agree(id){
		$('#no_agree_id').val(id);
		$("#tuikuan_order").hide();
		$("#not_drawback").show();
	}
	
	
	
</script>
<style>
	.bank {
		width: 150px;
		height: 30px;
		text-align: center;
		border-radius: 5px;
	}
	
	li {
		list-style: none;
	}
</style>

	</body>

</html>